#include <iostream>
#include <string>
#include <array>

class A {
public:
	A() {
		std::cout << "default constructor" << std::endl;
	}

	A(int a) {
		std::cout << "A(int a), a: " << a << std::endl;
	}

	A(const A& a) {
		std::cout << "copy constructor" << std::endl;
	}

	A(int a, int b) {
		std::cout << "A(int a, int b), a: " << a << ", b: " << b << std::endl;
	}
};

class B {
	//int a(10);
	int a1{ 10 };
public:
	B(A a) {

	}
};

void Func(A a) {
}

A Func1() {
	/*
	* A a(1, 2);
	* return a;
	*/
	return A(1, 2);
}

A Func2() {
	return { 3, 4 };
}

void f(double value) {
	int i(int(value));
}

class Aggregate {
public:
	Aggregate() = default;

public:
	int a;
	float b;
	std::string c;
};

int main() {
	/*A a;

	A a1(10);
	A a1_ = 20;

	A a2(a);
	A a2_ = a;*/


	/*A a{};

	A a1{ 10 };

	A a2{ a };*/


	/*A a(10, 20);

	A a1 = { 20, 30 };*/


	/*Func(A(10, 20));

	Func({ 20, 30 });

	A a1 = Func1();

	A a2 = Func2();*/


	/*A a{10.0};	// conversion from 'double' to 'int' requires a narrowing conversion

	A a1();	// declare a function ?! */


	/*Aggregate agg = {0, 0.5f, "abcd"};*/

	
	/*B b(A());
	B b1{ A() };*/


	/*struct S {
		int x;
		int y;
	};

	int a[3] = { 1, 2, 3 };
	std::array<int, 3> a1 = { 1, 2, 3 };

	S a3[3] = { {1, 2}, {3, 4}, {5, 6} };
	S a3_[3] = { 1, 2, 3, 4, 5, 6 };
	std::array<S, 3> a4 = { {1, 2}, {3, 4}, {5, 6} };
	std::array<S, 3> a4_ = { 1, 2, 3, 4, 5, 6 };

	std::array<S, 3> a5 = { { {1, 2}, {3, 4}, {5, 6} } };*/


	class Widget {
	public:
		Widget() {
			std::cout << "Widget()" << std::endl;
		}
		Widget(int i, double d) {
			std::cout << "Widget(int i, double d)" << std::endl;
		}

		Widget(std::initializer_list<int> il) {
			std::cout << "Widget(std::initializer_list<int> il), size: " << il.size() << std::endl;
		}
	};

	//Widget w1(1, 10.0);
	//Widget w2{ 1, 10.0 };
	//Widget w3{ { 1, 10.0 } };

	Widget w4{ {} };

	Widget w5{};
}